package com.xckj.teacher.util

import com.github.mikephil.charting.data.Entry
import com.github.mikephil.charting.formatter.ValueFormatter
import com.github.mikephil.charting.utils.ViewPortHandler
import java.text.DecimalFormat

class MyValueFormatter : ValueFormatter() {
    private val mFormat: DecimalFormat = DecimalFormat("###,###,##0.00")

    init {
        // 2 decimal places
    }

    override fun getFormattedValue(value: Float): String {
        return super.getFormattedValue(value)
    }

    override fun getFormattedValue(
        value: Float,
        entry: Entry,
        dataSetIndex: Int,
        viewPortHandler: ViewPortHandler
    ): String {
        return entry.x.toString() // Append $ sign
    }
}
